﻿using AutoMapper;
using GGetTestService.Dto.Teacher;
using GGetTestService.Entity;
using System;

namespace GGetTestService.Mapper.Profiles
{
    public class TeacherProfile : Profile
    {
        public TeacherProfile()
        {
            CreateMap<Teacher, TeacherDto>()
                .ForMember(dst => dst.Students, x => x.MapFrom(x => x.Students));

            CreateMap<TeacherAddDto, Teacher>()
                .ForMember(dst => dst.Id, x => x.MapFrom(y => Guid.NewGuid()));
        }
    }
}
